<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>左</title>
</head>
<style>
    a{
        color: black;
        text-decoration: none;
    }
    h3{
        background: #efe7de;
        width: 100px;
        height: 50px;
        border-radius: 10px;
        text-align: center;
        line-height: 50px;
    }
</style>
<script type="text/javascript" src="../../js/jquery-3.6.0.min.js"></script>
<body style="background: #f7f1e3;">
<div style="padding-left: 50px;">
    <h3>
        <a th:href="@{authorCenter}" target="main">专区首页</a>
    </h3>
    <h3>
        <a th:href="@{bookManager}" target="main">作品管理</a>
    </h3>
    <h3>
        <a th:href="@{toBookData}" target="main">作品数据</a>
    </h3>
    <h3>
        <a th:href="@{queryUserById}" target="main">个人中心</a>
    </h3>
    <h3>
        <a th:href="@{queryLetter}" target="main">站内短信
        <span id="sp1"></span>
        </a>
    </h3>

</div>
</body>
<script>
    $(function (){
        queryUnreadLetter();
    })
    function queryUnreadLetter(){
        $.ajax({
            url:"queryUnreadLetter",
            type:"get",
            dataType:"text",
            success:function (data){
                if (data != 0){
                    $("#sp1").html("<font color='white' size='2' style='background: red; border-radius: 5px;'>" + data + "</font>")
                }
            },error:function (){
                alert("查询失败");
            }
        })
    }

</script>
</html>